const { override, fixBabelImports, addWebpackPlugin, addWebpackAlias, overrideDevServer, removeModuleScopePlugin } = require('customize-cra');
const AntdDayjsWebpackPlugin = require('antd-dayjs-webpack-plugin');
const path = require('path');
const { devServer } = require("./devServer");
console.log(12,path.resolve(__dirname, "src").replace(/\\/g, "/"))
module.exports = {
  webpack: override(
    fixBabelImports('import', {
      libraryName: 'antd',
      libraryDirectory: 'es',
      style: true,
    }),
    addWebpackPlugin(new AntdDayjsWebpackPlugin({
      preset: 'antdv3'
    })),
    addWebpackAlias({ // 配置别名Alias，需要配合tsconfig.json的paths属性
      ["@"]: path.resolve(__dirname, "src"),
      ["@components"]: path.resolve(__dirname, "src/components")
    }),
    removeModuleScopePlugin(),
  ),
  devServer: overrideDevServer(
    // dev server plugin
    devServer()
  )
}